package ssm.another;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by 58296 on 2016/8/4.
 */
public class DateUtils {

    public static Date stringToDate(String str) throws Exception{
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        return formatter.parse(str);
    }

    public static String dateToString(Date date) throws Exception {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        return formatter.format(date);
    }
}
